<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>[%$softtitle%]</title>
<link href="templates/css/baselist.css" rel="stylesheet" type="text/css" />
<link href="templates/css/all.css" rel="stylesheet" type="text/css" />
<link href="templates/css/clickmenu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/control.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript" src="js/passcheck.js"></script>
<script type="text/javascript" src="js/cityselect.js"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodyauto")){
			$('.manageadd').css({height:h-40});
			$('.manageedit').css({height:h-40});
		}
	}
	var membermain_js_password_empty  = "[%$ST.membermain_js_password_empty%]";
	var membermain_js_password_error  = "[%$ST.membermain_js_password_error%]";
	var membermain_js_email_empty  = "[%$ST.membermain_js_email_empty%]";
	var membermain_js_birthday_empty  = "[%$ST.membermain_js_birthday_empty%]";
	var membermain_js_zipcode_empty  = "[%$ST.membermain_js_zipcode_empty%]";
	var membermain_js_qq_empty  = "[%$ST.membermain_js_qq_empty%]";
	var membermain_js_edit_ok = "[%$ST.membermain_js_edit_ok%]";
	var membermain_js_edit_no = "[%$ST.membermain_js_edit_no%]";
	var password_err1 = "[%$ST.password_err1%]";
	var password_err2 = "[%$ST.password_err2%]";
	var password_err3 = "[%$ST.password_err3%]";
	var password_err4 = "[%$ST.password_err4%]";
	var password_err5 = "[%$ST.password_err5%]";
	var iframename = "[%$iframename%]";
	$(document).ready(function(){
		$('#password').ESPpasscheck({
			verdects:[password_err1,password_err2,password_err3,password_err4,password_err5]
		});
		var h = '[%$iframeheightwindow%]';
		$('.manageadd').css({height:h-40});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse
		}
		$('#memberedit').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
		sec_cityone([%$memread.country%],[%$memread.province%]);
		sec_citytwo([%$memread.province%],[%$memread.city%]);
		sec_district([%$memread.city%],[%$memread.district%]);
	})




	function formverify(formData) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['password']!="") {
			if(get['password'].length<6) {
				document.memberedit.password.focus();
				alert(membermain_js_password_empty);
				return false;
			}
			if( get['password2'] != get['password'] ) {
				document.memberedit.password.focus();
				alert(membermain_js_password_error);
				return false;
			}
		}
		if(get['email'].match(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/ig)==null) {
			document.memberedit.email.focus();
			alert(membermain_js_email_empty);
			return false;
		}
		if(get['birthday']!=""){
			if(get['birthday'].match(/^[1-9][0-9]{3}\-[0-9]{2}\-[0-9]{2}$/ig)==null) {
				document.memberedit.birthday.focus();
				alert(membermain_js_birthday_empty);
				return false;
			}
		}
		if(get['zipcode']!=""){
			if(get['zipcode'].match(/^[0-9]+$/ig)==null) {
				document.memberedit.zipcode.focus();
				alert(membermain_js_zipcode_empty);
				return false;
			}
		}
		if(get['qq']!=""){
			if(get['qq'].match(/^[0-9]+$/ig)==null) {
				document.memberedit.qq.focus();
				alert(membermain_js_qq_empty);
				return false;
			}
		}
		parent.windowsdig('Loading','iframe:index.php?archive=management&action=load','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			parent.frames[iframename].refresh('selectform','selectall','check_all');
			alert(membermain_js_edit_ok);
		}else{
			alert(membermain_js_edit_no);
		}
		parent.onaletdoc()
	}
</script>
</head>

<body>
<form name="memberedit" id="memberedit" method="post" action="index.php?archive=membermain&action=membersave">
	<input type="hidden" name="inputclass" value="edit">
	<input type="hidden" name="userid" value="[%$memread.userid%]">
	<input type="hidden" name="username" value="[%$memread.username%]">
	<input type="hidden" name="passwordold" value="[%$memread.password%]">
	<div id="mainbodyauto" class="manageadd">
		<div class="maindobycontent">
			<!--查看已选择的类型-->
			<div class="suggestion">
				<span class="sugicon"><span class="strong colorgorning2">[%$ST.position_title%]</span><span class="colorgorningage">[%$ST.membermain_edit_mess%] <u>[%$memread.username%] [%$memread.addtime|timeformat(3)%] </u></span></span>
			</div>
			<div class="sugtitle">
				<span class="sugtitleicon"><span class="strong colorgorning2">[%$ST.membermain_add_usernametype%]</span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv">
				<table border="0" width="100%">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.membermain_add_username%]</td>
						<td width="85%" class="trtitle02">[%$memread.username%]</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.membermain_text_visitcount%]</td>
						<td width="85%" class="trtitle02">[%$memread.visitcount%]</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.membermain_edit_lastip%]</td>
						<td width="85%" class="trtitle02">[%$memread.lastip|ip(0)%]</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_text_lasttime%]</td>
						<td class="trtitle02">[%$memread.lasttime|timeformat(3)%]</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_edit_password%]</td>
						<td class="trtitle02">
							<input type="password" name="password" size="20" maxlength="16" class="infoInput" id="password">
							<span class="cautiontitle">[%$ST.membermain_edit_password_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_password2%]</td>
						<td class="trtitle02"><input type="password" name="password2" size="20" maxlength="16" class="infoInput"></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_passwordcheck%]：</td>
						<td class="trtitle02"><span id="passlist"></span></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_email%]</td>
						<td class="trtitle02"><input type="text" name="email" maxlength="100" size="40" value="[%$memread.email%]" class="infoInput"></td>
					</tr>
					<tr class="trstyle2" id="select1">
						<td class="trtitle01">[%$ST.membermain_add_question%]</td>
						<td class="trtitle02"><input type="text" name="question" maxlength="100" size="40" value="[%$memread.question%]" class="infoInput"><span class="cautiontitle">[%$ST.membermain_add_question_mess%]</span></td>
					</tr>
					<tr class="trstyle2" id="select2">
						<td class="trtitle01">[%$ST.membermain_add_answer%]</td>
						<td class="trtitle02"><input type="text" name="answer" maxlength="100" size="40" value="[%$memread.answer%]" class="infoInput"></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.membermain_add_mcid%]</td>
						<td width="85%" class="trtitle02">
							<select name="mcid" id="mcid">
								[%forlist from=$memberpuvlist key=i%]
								<option [%$memberpuvlist[i].selected%] value="[%$memberpuvlist[i].mcid%]">[%$memberpuvlist[i].rankname%]</option>
								[%/forlist%]
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.membermain_add_infomation%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="isinfo" checked="checked" onclick="ondisplay('infomationdiv','displaytrue')"/> [%$ST.is_yes%]&nbsp;
							<input type="radio" value="0" name="isinfo" onclick="ondisplay('infomationdiv','displaynone')"/> [%$ST.is_no%]
						</td>
					</tr>
				</table>
			</div>
			<div class="displaytrue" id="infomationdiv">
				<div class="sugtitle">
					<span class="sugtitleicon"><span class="strong colorgorning2">[%$ST.membermain_add_countustype%]</span></span>
				</div>
				<div class="sugtitle-line"></div>
				<div class="formdiv">
					<table border="0" width="100%">
						<tr class="trstyle2">
							<td class="trtitle01" width="15%">[%$ST.membermain_add_alias%]</td>
							<td class="trtitle02" width="85%"><input type="text" value="[%$memread.alias%]" name="alias" maxlength="20" size="20" class="infoInput"></td>
						</tr>
						<tr class="trstyle2">
							<td class="trtitle01">[%$ST.membermain_add_sex%]</td>
							<td class="trtitle02">
								<input type="radio" value="1" name="sex"[%if $memread.sex==1%] checked="checked"[%/if%]> [%$ST.select_sex_1%]&nbsp;
								       <input type="radio" value="0" name="sex"[%if $memread.sex==0%] checked="checked"[%/if%]> [%$ST.select_sex_0%]
							</td>
						</tr>
						<tr class="trstyle2">
							<td class="trtitle01">[%$ST.membermain_add_tel%]</td>
							<td class="trtitle02"><input type="text" name="tel" maxlength="20" value="[%$memread.tel%]" size="20" class="infoInput"><span class="cautiontitle">[%$ST.membermain_add_tel_mess%]</span></td>
						</tr>
						<tr class="trstyle2">
							<td class="trtitle01">[%$ST.membermain_add_motel%]</td>
							<td class="trtitle02"><input type="text" name="mobile" value="[%$memread.mobile%]" maxlength="20" size="20" class="infoInput"></td>
						</tr>
						<tr class="trstyle2">
							<td class="trtitle01">[%$ST.membermain_add_birthday%]</td>
							<td class="trtitle02">
								<input type="text" name="birthday" value="[%$memread.birthday|timeformat(2)%]" maxlength="20" size="20" class="infoInput">
								<span class="cautiontitle">[%$ST.membermain_add_birthday_mess%]</span>
							</td>
						</tr>
						<tr class="trstyle2">
							<td class="trtitle01">[%$ST.membermain_add_country%]</td>
							<td class="trtitle02">
								<select size="1" name="cityone" class="select" id="cityone">
									<option [%if $memread.country==0%]selected [%/if%]value="0">[%$ST.membermain_add_country_option%]</option>
									<option [%if $memread.country==1%]selected [%/if%]value="1">[%$ST.membermain_add_country_value%]</option>
								</select>
								<select size="1" name="citytwo" class="select" id="citytwo">
									<option selected value="0">[%$ST.membermain_add_province_option%]</option>
								</select>
								<select size="1" name="citythree" class="select" id="citythree">
									<option selected value="0">[%$ST.membermain_add_city_option%]</option>
								</select>
								<select size="1" name="district" class="select" id="district">
									<option selected value="0">[%$ST.membermain_add_district_option%]</option>
								</select>
								<span id="cityloading">Loading…</span>
							</td>
						</tr>
						<tr class="trstyle2">
							<td class="trtitle01">[%$ST.membermain_add_address%]</td>
							<td class="trtitle02"><input type="text" name="address" value="[%$memread.address%]" maxlength="120" size="60" class="infoInput"></td>
						</tr>
						<tr class="trstyle2">
							<td class="trtitle01">[%$ST.membermain_add_zipcode%]</td>
							<td class="trtitle02"><input type="text" name="zipcode" value="[%$memread.zipcode%]" maxlength="10" size="10" class="infoInput"></td>
						</tr>
						<tr class="trstyle2">
							<td class="trtitle01">[%$ST.membermain_add_msn%]</td>
							<td class="trtitle02"><input type="text" name="msn" value="[%$memread.msn%]" maxlength="50" size="30" class="infoInput"></td>
						</tr>
						<tr class="trstyle2">
							<td class="trtitle01">[%$ST.membermain_add_qq%]</td>
							<td class="trtitle02"><input type="text" name="qq" value="[%$memread.qq%]" maxlength="10" size="15" class="infoInput"></td>
						</tr>
					</table>
				</div>
			</div>
			<div class="sugtitle">
				<span class="sugtitleicon"><span class="strong colorgorning2">[%$ST.membermain_add_otherinfotext%]</span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv">
				<table border="0" width="100%">
				[%forlist from=$attrread key=i%]
					[%if $attrread[i].isline==1%]
					<tr class="trstyle2">
						<td colspan="2">
							<div class="sugtitle">
								<span class="sugtitleicon"><span class="strong colorgorning2">[%$attrread[i].typename%]</span></span>
							</div>
							<div class="sugtitle-line"></div>
						</td>
					</tr>
					[%else%]
					<tr class="trstyle2">
						<td class="trtitle01" width="15%">[%$attrread[i].typename%]</td>
						<td class="trtitle02" width="85%">
						[%if $attrread[i].inputtype=='string'%]<input type="text"[%if$attrread[i].isvalidate==1%] onblur="if (this.value.match(/^[%$attrread[i].validatetext%]$/ig)==null){alert('[%$attrread[i].typename%][%$ST.input_err%]');return false;}" [%/if%]name="memberatt[[%$attrread[i].attrname%]]" size="[%$attrread[i].attrsize%]" maxlength="[%$attrread[i].attrlenther%]" value="[%$attrread[i].attrvalue%]" class="infoInput"/>[%/if%]
						[%if $attrread[i].inputtype=='int'%]<input type="text" [%if$attrread[i].isvalidate==1%] onblur="if (this.value.match(/^[%$attrread[i].validatetext%]$/ig)==null){alert('[%$attrread[i].typename%][%$ST.input_err%]');return false;}" [%/if%]name="memberatt[[%$attrread[i].attrname%]]" size="[%$attrread[i].attrsize%]" maxlength="[%$attrread[i].attrlenther%]" value="[%$attrread[i].attrvalue%]" class="infoInput"/>[%/if%]
						[%if $attrread[i].inputtype=='datetime'%]
												      <input type="text" id="dataselect" name="memberatt[[%$attrread[i].attrname%]]" size="[%$attrread[i].attrsize%]" value="[%$attrread[i].attrvalue%]" class="infoInput"/>
						[%/if%]
						[%if $attrread[i].inputtype=='img'%]
							<input type="text" [%if$attrread[i].isvalidate==1%] onblur="if (this.value.match(/^[%$attrread[i].validatetext%]$/ig)==null){alert('[%$attrread[i].typename%][%$ST.input_err%]');return false;}" [%/if%]name="memberatt[[%$attrread[i].attrname%]]" id="[%$attrread[i].attrname%]" size="[%$attrread[i].attrsize%]" value="[%$attrread[i].attrvalue%]" class="infoInput"/>
							       <a class="filecheck" onclick="javascript:windowsdig('[%$ST.filemanage_select_title%]','iframe:index.php?archive=filemanage&action=filemanage&listfunction=filelist&filetype=img&checkfrom=input&fileinputid=[%$attrread[i].attrname%]','900px','480px','iframe')" href="#body">[%$ST.selectfile_botton%]</a>
						[%/if%]
						[%if $attrread[i].inputtype=='addon'%]
							<input type="text" name="memberatt[[%$attrread[i].attrname%]]" id="[%$attrread[i].attrname%]" size="[%$attrread[i].attrsize%]" value="[%$attrread[i].attrvalue%]" class="infoInput"/>
							<a class="filecheck" onclick="javascript:windowsdig('[%$ST.filemanage_select_title%]','iframe:index.php?archive=filemanage&action=filemanage&listfunction=filelist&filetype=img&checkfrom=input&fileinputid=[%$attrread[i].attrname%]','900px','480px','iframe')" href="#body">[%$ST.selectfile_botton%]</a>
						[%/if%]
						[%if $attrread[i].inputtype=='text'%]<textarea name="memberatt[[%$attrread[i].attrname%]]" cols="[%$attrread[i].attrsize%]" rows="[%$attrread[i].attrrow%]" class="infoInput">[%$attrread[i].attrvalue%]</textarea>[%/if%]
						[%if $attrread[i].inputtype=='select'%]
							<select size="1" name="memberatt[[%$attrread[i].attrname%]]">
							[%forlist from=$attrread[i].attrvalue key=ii%]
								<option [%if $attrread[i].attrvalue[ii].selected=='selected'%]selected="selected" [%/if%]value="[%$attrread[i].attrvalue[ii].name%]">[%$attrread[i].attrvalue[ii].name%]</option>
							[%/forlist%]
							</select>
						[%/if%]
						[%if $attrread[i].inputtype=='radio'%]
							[%forlist from=$attrread[i].attrvalue key=ii%]
							<input [%if $attrread[i].attrvalue[ii].selected=='selected'%]checked="checked" [%/if%]name="memberatt[[%$attrread[i].attrname%]]" type="radio" value="[%$attrread[i].attrvalue[ii].name%]" /> [%$attrread[i].attrvalue[ii].name%]
							[%/forlist%]
						[%/if%]
						[%if $attrread[i].inputtype=='checkbox'%]
							[%forlist from=$attrread[i].attrvalue key=ii%]
								<input [%if $attrread[i].attrvalue[ii].selected=='selected'%]checked="checked" [%/if%]name="memberatt[[%$attrread[i].attrname%]][]" type="checkbox" value="[%$attrread[i].attrvalue[ii].name%]" /> [%$attrread[i].attrvalue[ii].name%]
							[%/forlist%]
						[%/if%]
						[%if $attrread[i].attrcue!=''%]<span class="cautiontitle">[%$attrread[i].attrcue%]</span>[%/if%]
						</td>
					</tr>
					[%/if%]
				[%/forlist%]
				</table>
			</div>
		</div>
	</div>
	<div id="downbotton">
		<div id="subbotton">
			<table border="0" width="100%">
				<tr>
					<td id="right"><input type="submit" name="Submit" value="[%$ST.botton_edit%]" class="buttonface" /></td>
					<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:parent.onaletdoc();" value="[%$ST.botton_edit_reset%]" class="buttonface" /></td>
				</tr>
			</table>
		</div>
	</div>
</form>
</body>

</html>